import QtQuick 1.0
import "CommomUtil.js" as Util
import "Modulelib.js" as ModuleUtil

Item{
    id: container
    width: 140; height: 105

    property string picTitle: ""

    property string smallPicPath: ""

    property string bigPicPath: ""

    property int picIndex: 0

    Rectangle{
        id: pic_rect
        color: "#66666f"
        anchors.fill: parent
        border.width: 1
        border.color: "gray"
        radius: 5
        Image {
            source: smallPicPath
            width:120; height: 90
            anchors.centerIn: parent

        }
        MouseArea{
            id: image_mouseArea
            anchors.fill: parent
            onClicked: {
                ModuleUtil.current_photo_currentPage = container.picIndex + 1 + (modulepiclist_page.currentPage - 1) * modulepiclist_page.pageSize;
                ModuleUtil.current_photo_totalCount = modulepiclist_page.totalNum;
                ModuleUtil.current_photo_title = container.picTitle;
                ModuleUtil.current_photo_bigPath = container.bigPicPath;
                ModuleUtil.current_photo_imgType = modulepiclist_page.imgType;
                Util.openFile("ModuleBigPicPage.qml");
            }


        }

        states: [
            State {
                name: 'pressed'; when: image_mouseArea.pressed
                PropertyChanges { target: pic_rect; focus: true; opacity: 0.5}
            }
        ]
    }

}
